package svc

import (
	"im_sys/apps/im/immodels"
	"im_sys/apps/im/ws/internal/config"
	"im_sys/apps/task/mq/mq_client"
)

type ServiceContext struct {
	Config config.Config

	immodels.ChatLogModel

	mq_client.MqClient
}

func NewServiceContext(c config.Config) *ServiceContext {
	return &ServiceContext{
		Config: c,

		ChatLogModel: immodels.NewChatLogModel(c.MongoDB.Url, c.MongoDB.DB, c.MongoDB.Collection),

		MqClient: mq_client.NewMsgMqClient(c.KafkaConf.Brokers, c.KafkaConf.Topic),
	}
}
